package edu.spec.wfl.week09.class2.homework.Two;

public class Food {
    private String name;//成员属性1，姓名，name，String类型，访问类型为private
    private int price;//成员属性2，价格，price，int类型,访问类型为private

    //构造方法：自行设计
    public Food(){};
    public Food(String name, int price) {
        this.name = name;
        this.price = price;
    }

    //成员方法：成员属性对应的setter和getter
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getPrice() {
        return price;
    }
    public void setPrice(int price) {
        this.price = price;
    }
}
